<?php

class PHPSession implements ArrayAccess
{
	
	public function start ( )
	{
		session_start ( ) ;
	}
	
	public function stop ( )
	{
		$_SESSION = array ( ) ;
		session_unset ( ) ;
		session_destroy ( ) ;
	}
	
	public function getSessionId ( )
	{
		return session_id ( ) ;
	}
	
	public function offsetExists ( $offset )
	{
		return isset ( $_SESSION[$offset] ) ;
	}
	
	public function offsetGet ( $offset )
	{
		if ( $this->offsetExists ( $offset ) ) return $_SESSION[$offset] ;
		return null ;
	}
	
	public function offsetSet ( $offset, $value )
	{
		$_SESSION[$offset] = $value ;
		return ;
	}
	
	public function offsetUnset ( $offset )
	{
		if ( $this->offsetExists ( $offset ) ) unset ( $_SESSION[$offset] ) ;
		return ;
	}
	
}

?>